<!--
 * @Descripttion:
 * @version: 1.0
 * @Author: lynn
 * @Date: 2020-10-20 12:37:56
 * @LastEditors: lynn
 * @LastEditTime: 2020-10-20 12:55:08
-->
<template>
  <div>
    <h2>商品管理</h2>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column label="名称" width="180">
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.name }}</span>
        </template>
      </el-table-column>
      <el-table-column label="分类标签" width="180">
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.tag }}</span>
        </template>
      </el-table-column>
      <el-table-column label="规格" width="180">
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.size }}</span>
        </template>
      </el-table-column>
      <el-table-column label="价格" width="180">
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.price }}</span>
        </template>
      </el-table-column>
      <el-table-column label="条形码" width="180">
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.code }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" width="180">
        <template slot-scope="scope">
          <span style="margin-left: 10px">{{ scope.row.remark }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
            size="mini"
            @click="handleEdit(scope.$index, scope.row)"
          >编辑</el-button>
          <el-button
            size="mini"
            type="danger"
            @click="handleDelete(scope.$index, scope.row)"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          name: 'jing',
          tag: '2016-05-02',
          size: '2016-05-02',
          price: '王小虎',
          remark: '上海市普陀区金沙江路 1518 弄',
          tag: 'Java',
          code: 'java'
        },
        {
          name: 'jing',
          tag: '2016-05-02',
          size: '2016-05-02',
          price: '王小虎',
          remark: '上海市普陀区金沙江路 1518 弄',
          tag: 'Java',
          code: 'java'
        },
        {
          name: 'jing',
          tag: '2016-05-02',
          size: '2016-05-02',
          price: '王小虎',
          remark: '上海市普陀区金沙江路 1518 弄',
          tag: 'Java',
          code: 'java'
        }
      ]
    }
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row)
    },
    handleDelete(index, row) {
      console.log(index, row)
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
